package com.xucan.CloseAbable;

import java.io.Closeable;
import java.io.IOException;

public class MyResource implements Closeable {
    @Override
    public void close() throws IOException {
        System.out.println("Closing...");
    }
    public static void main(String[] args) {
        try( MyResource resource = new MyResource()) {
            // Use the resource
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
